package cake.web.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cake.dao.UserDao;
import cake.dao.impl.UserDaoImpl;
@WebServlet("/register")
public class RegisterCheckNameServlet extends HttpServlet{
	
	private UserDao userDao=new UserDaoImpl();
	
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String userName=req.getParameter("username");
		boolean isExit=userDao.checkUserName(userName);
		resp.getWriter().print(isExit);
	}
}
